package com.leyou.client;

import com.leyou.common.PageResult;
import com.leyou.pojo.Sku;
import com.leyou.pojo.Spu;
import com.leyou.pojo.SpuDetail;
import com.leyou.pojo.SpuVo;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RequestMapping("spu")
public interface SpuClientServer {
    //分页查询spu
    @RequestMapping("page")
    public PageResult<SpuVo> page(
            @RequestParam(value = "key",required = false)String key,
            @RequestParam(value = "saleable",defaultValue = "2")Integer saleable,
            @RequestParam(value = "page",defaultValue = "1")Integer page,
            @RequestParam(value = "rows",defaultValue = "5")Integer rows

    );

    //通过spu的id获取对应的detail
    @RequestMapping("detail/{spu_id}")
    public SpuDetail detail(@PathVariable("spu_id") Integer spu_id);

   //根据spu的id 查询spu
    @RequestMapping("findSpuBuId")
    public  Spu findSpuBuId(@RequestParam("spuid") Integer spuid);



    //通过spu的id获取sku的集合
    @RequestMapping ("list")
    public List<Sku> list(@RequestParam("id") Integer id);




}
